package org.jeik.data.models;

import java.io.File;
import java.util.List;

import org.jeik.data.services.ServiceBase.Tables;

/**
 * 
 * @author AAsha
 *
 */
public class Attachment implements Model{
	
	private Long id;
	private String attachmentTitle;
	private String attachmentFileName;
	private transient File file;
	
	public Attachment() {
	}
	
	
	
	public Attachment(Long id, String attachmentTitle,
			String attachmentFileName, File file) {
		super();
		this.id = id;
		this.attachmentTitle = attachmentTitle;
		this.attachmentFileName = attachmentFileName;
		this.setFile(file);
	}



	public String getAttachmentTitle() {
		return attachmentTitle;
	}
	public void setAttachmentTitle(String attachmentTitle) {
		this.attachmentTitle = attachmentTitle;
	}
	public String getAttachmentFileName() {
		return attachmentFileName;
	}
	public void setAttachmentFileName(String attachmentFileName) {
		this.attachmentFileName = attachmentFileName;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Override
	public String getTableName() {
		return Tables.attachments.name();
	}

	@Override
	public List<String> getFields() {
		return null;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Attachment other = (Attachment) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}



	public File getFile() {
		return file;
	}



	public void setFile(File file) {
		this.file = file;
	}
	
	
	
}
